/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fandi.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Fandy
 */
public class DateFormatterUtil {
    
    public static String formatNow(String format, Date inputDate) {
        
        format = (format.equals("") || format == null)? "yyyy-MM-dd" : format;
        
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        String returnVal = formatter.format(inputDate);
        
        return returnVal;
    }
}
